package com.amazon.jobtest.util;

import java.util.Comparator;

import com.amazon.jobtest.TestResult;

public class TestScoreComparator implements Comparator<TestResult>{

	/**
	 * Implements compare for be possible a test result list be ordened
	 * by an Java list structure, it orders by score in a descendant order
	 */
	@Override
	public int compare(TestResult o1, TestResult o2) {
		if(o1.getScore() < o2.getScore()){
			return 1;
		}else if(o1.getScore() == o2.getScore()){
			return 0;
		}else{
			return -1; 
		}
	}

}
